<ul>
<h1>博主信息 <g:if test="${site.author in Teacher}"> (老师)</g:if> <g:if test="${site.author in Classer}"> (班级)</g:if></h1>
  
    <%
    def avatar
    if(site?.author){
        if(site.author in Teacher){
            avatar = site?.author?.teacherInfo?.avatar?.id
        }else if(site.author in Student){
            avatar = site?.author?.studentInfo?.avatar?.id
        }
    }
    %>
    <g:if test="${avatar}">
      <img src="/blog/download/index/${avatar}"/>
    </g:if>
    <li>${site?.author?.name}<br>
    <li>${site?.author?.school?.name}<br>
    <%
    def classes
    if(site?.author){
        if(site.author in Teacher){
            classes = Classer.findAllByMaster(site.author.hostId)
        }
    }
    %>
    <g:if test="${classes}">
        所带班级：
         
        <g:each in="${classes}" status="i" var="classerInstance">
            <li><g:link controller="home" action="blog" title="${classerInstance.classesName}" id="${classerInstance.id}">${classerInstance.classesName}</g:link><br>
        </g:each>
         
    </g:if>
    <%
    def classer
    def master
    if(site?.author?.classesId != 0){
        classer = Classer.findByHostId(site.author.classesId)
        if(classer){
            master = Teacher.findByHostId(classer.master)
        }
    }
    %>
    
    <g:if test="${classer}">
        <li>班级： 
       <li><g:link controller="home" action="blog" title="${classer.name}" id="${classer.id}">${classer.name}</g:link>
        
    </g:if>
    <g:if test="${master}">
       <li> 班主任： <g:link controller="home" action="blog" title="${master.name}" id="${master.id}">${master.name}</g:link> 
    </g:if>

    <li>博文数： ${site?.author?.posts?.size()} 
    <%
    def studentInfo
    if(site.author && site.author in Student){
        studentInfo = site.author.studentInfo
    }
    %>
    <g:if test="${studentInfo}">
            <li>个人介绍：${studentInfo?.introduce} 
            <li>兴趣爱好：${studentInfo?.interest} 
    </g:if>
    <li><g:link controller="home" action="blog" title="${site?.title}" id="${site?.author?.id}">进入他的blog</g:link>
 
</ul>